// VocoderGUIDlg.h : header file
//

#pragma once

#include "afxwin.h"
#include "afxcmn.h"
#include "../Vocoder/Settings.h"
#include "TextProvider.h"

class VocoderController;
class Recorder;

// CVocoderGUIDlg dialog
class CVocoderGUIDlg : public CDialog, public SettingsProvider, public TextProvider
{
// Construction
public:
	CVocoderGUIDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_VOCODERGUI_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

	/*
	TextProvider implementation
	*/
	WCHAR* NextText();

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()

public:
	VocoderController* controller;
	Recorder* recorder;
	
	bool IsRecording();
	int GetFrequency();
	int GetFrequencyVariation();
	int GetBrownNoise();
	int GetWhiteNoise();
	int GetTriangular();
	int GetSquare();
	int GetSawtooth();
	int GetSine();
	int GetSineF2();
	int GetSineF3();
	int GetSineF4();
	int GetSineF5();
	int GetSineF6();
	int GetSineF7();
	int GetRandom();
	int GetFunction1();
	int GetFunction2();
	int GetFunction3();

	void UpdateSettings(Settings* settings);

	CSliderCtrl sliderFrequency;
	CSliderCtrl sliderFreqVar;
	CSliderCtrl sliderRandom;
	CSliderCtrl sliderWhiteNoise;
	CSliderCtrl sliderBrownNoise;
	CSliderCtrl sliderTriangular;
	CSliderCtrl sliderSquare;
	CSliderCtrl sliderSawtooth;
	CSliderCtrl sliderSine;
	CSliderCtrl sliderSineF2;
	CSliderCtrl sliderSineF3;
	CSliderCtrl sliderSineF4;
	CSliderCtrl sliderSineF5;
	CSliderCtrl sliderSineF6;
	CSliderCtrl sliderSineF7;
	CSliderCtrl sliderFunc1;
	CSliderCtrl sliderFunc2;
	CSliderCtrl sliderFunc3;

	CComboBox comboOutput;
	CButton checkRecord;
	CEdit ptAmplitudeThreshold;
	CEdit ptNoiseThreshold;
	CEdit editModulator;

	afx_msg void OnBnClickedButtonPlay();
	afx_msg void OnBnClickedButtonUpdateModulator();
	CButton checkVocoderNormalize;
	CButton checkMixModulator;
	CButton btnUseModulatorAmplitude;

	std::wstring lastText;
	CComboBox comboVoice;
	afx_msg void OnCbnSelchangeCombovoice();
};
